arr=[1,4,3,4,5,6,7]
//1.set去重，set的值不能重复
arr1 =  [...new Set(arr)]
console.log(arr1)
//2.循环 只存储第一次出现的值
arr2 = arr.filter((item, index)=>arr.indexOf(item)==index)
console.log(arr2)